require.config({
    baseUrl: '/app',
    urlArgs: function(name,url){
        if(url.indexOf('cdn.ldtamp.com/libs')>-1){
            return '';
        }
        else if(url.indexOf('ldfw')>-1){
            return '?v=1.3.1'
        }
        return '?v=1.3.3'
    },
    packages: [
        {
            name: 'crypto-js',
            location: '../libs/crypto-js',
            main: 'index'
        }
    ],
    map: {
        '*': {
        }
    },
    paths:{
        assets:'../assets',
        art:'../libs/template-web.min',//art-template.js
        backbone: '../libs/backbone',//外部库的Require支持都需要小写
        base64:'../ldfw/ldlibs/base64',
        bscroll:'../libs/bscroll',
        css:'../libs/css-0.1.8',//require-css
        'city-picker':'../libs/weui/city-picker',
        draggabilly:'../libs/draggabilly.pkgd',
        echarts:'../libs/echarts-3.6.1/echarts.min',//echarts
        fastclick:'../libs/fastclick',
        jquery: '../libs/zepto',//JQuery支持Require需要用jquery作为别名
        'jquery-weui':'../libs/weui/jquery-weui',
        ldbiz:'../ldbiz',
        ldfw:'../ldfw',
        jweixin:'../libs/jweixin-1.2.0',
        localStorage:'../libs/backbone.localStorage-1.1.16',//Backbone.LocalStorage
        md5:'../ldfw/ldlibs/md5',
        spinjs:'../libs/spin.2.3.2',//
        'spark-md5':'../libs/spark-md5',
        text:'../libs/text-2.0.12',//requirejs-text
        underscore: '../libs/underscore-1.8.3',//外部库的Require支持都需要小写
        weui:'../libs/weui/weui',
        vconsole:'../libs/vconsole.min'
    },
    shim: {//引入没有使用requirejs模块写法的类库。backbone依赖underscore
        'ldfw/core':{
            deps:['backbone']
        },
        'backbone': {
            deps: ['underscore', 'jquery'],
            exports: 'Backbone'
        },
        'city-picker':{
            deps:['jquery-weui']
        },
        'jquery': {
            exports: '$'
        },
        'jquery-weui':{
            deps:['jquery','weui',]
        },
        'spark-md5':{
            exports:'SparkMD5'
        },
        'underscore': {
            exports: '_'
        }
    }
})
requirejs.onError = function (err) {
    console.log(err.requireType);
    if (err.requireType === 'timeout') {
        console.log('modules: ' + err.requireModules);
    }

    throw err;
};
